
// 封装axios
import axios from 'axios';
const instance = axios.create({
    baseURL: 'http://kumanxuan1.f3322.net:8001/',  // baseurl 公共域名
    timeout: 5000, // 网络请求时间
    headers: { 'Content-type': 'application/json' }
});

// 请求拦截器
axios.interceptors.request.use(function (config) {
    // Do something before request is sent
    // 逻辑处理
    return config;
}, function (error) {
    // Do something with request error
    return Promise.reject(error);
});

// 响应拦截器
axios.interceptors.response.use(function (response) {
    // Do something with response data
    // 逻辑处理
    return response;
}, function (error) {
    // Do something with response error
    return Promise.reject(error);
});

export default instance
